package com.melody.mapper;

import com.melody.entry.MusicInfo;
import com.melody.entry.PlaylistInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.melody.model.vo.PlaylistInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
* @author zxz
* @description 针对表【playlist_info(歌单信息表)】的数据库操作Mapper
* @createDate 2025-05-09 10:31:17
* @Entity com.melody.entry.PlaylistInfo
*/
public interface PlaylistInfoMapper extends BaseMapper<PlaylistInfo> {
    void insertPlaylist(PlaylistInfo playlistInfo);

    List<PlaylistInfo> selectPlaylistsByUserId(Map<String, Object> params);

    void updatePlaylistInfo(PlaylistInfo playlistInfo);

    /**
     * 根据歌单id获取歌单详细信息（歌单+歌曲列表）
     *
     * @param listId
     * @return
     */
    PlaylistInfoVo getSongListInfoById(Integer listId);

    List<PlaylistInfo> getRandomPlaylistInfo( @Param("limit") int limit,@Param("offset") int offset);

    List<PlaylistInfo> getRandomPlaylistInfos( @Param("limit") int limit);

    List<MusicInfo> getFavoriteByUserId(@Param("userId") Integer userId);
}




